import {reqprojectdata} from '@/api/request.js'

const state = {
    projectData: []
}

const mutations = {
    SET_PROJECT_DATA: (state, projectData) => {
        state.projectData = projectData
    }
}

const actions = {
    // user login
    reqprojectdata({ commit }, where) {
        return new Promise((resolve, reject) => {
            reqprojectdata(where).then(response => {
                const { data } = response.data
                // console.log("store/modules/depart", data)
                commit('SET_PROJECT_DATA', data)
                resolve(data)
            }).catch(error => {
                reject(error)
            })
        })
    },
}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}